package org.autumn.pool;

import java.util.Timer;
import java.util.TimerTask;

public class TimerTest {
    public static void main(String[] args) {
        Timer timer = new Timer();

        TimerTask t1 = new TimerTask() {
            @Override
            public void run() {
                System.out.println(1);
            }
        };

        TimerTask t2 = new TimerTask() {
            @Override
            public void run() {
                System.out.println(2);
            }
        };

        timer.schedule(t1, 1000);
        timer.schedule(t2, 2000);
    }
}
